Skip to content

Display Heritages in the Features Tab#22249

Open
iDantar wants to merge 2 commits into
foundryvtt:v14-devfrom
iDantar:22235-show-heritages-in-feats-tab
Open

Display Heritages in the Features Tab#22249
iDantar wants to merge 2 commits into
foundryvtt:v14-devfrom
iDantar:22235-show-heritages-in-feats-tab

Conversation

@iDantar
Copy link
Copy Markdown
Collaborator

@iDantar iDantar commented May 6, 2026

Closes #22235
Supersedes #22233

Inserts the heritage in Ancestry Features list and renders it's nested feats, if any.
Some examples:
image

Comment thread src/module/actor/character/sheet.ts Outdated
level: null,
feat: actor.heritage,
children: this.#getNestedSlots(actor.heritage),
} as never);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid casting to never. There's gotta be another way.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed and will keep in mind for the future

@@ -247,6 +247,9 @@ class CharacterFeats<TActor extends CharacterPF2e> extends Collection<string, Fe
if (granter?.isOfType("feat") && granter.grants.includes(feat) && isNested) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the practicality of including the heritage in granter.grants? It looks like grants in FeatPF2e is FeatPF2e | HeritagePF2e, so doing granter?.isOfType("feat", "heritage") && granter.grants.includes(feat) && isNested should be more terse

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that, but Heritage doesn't have .grants, so the check fails and granted items show in bonus feats as duplicates, unfortunately

Copy link
Copy Markdown
Collaborator Author

@iDantar iDantar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the review, finally got back to PC and addressed it - would you be able to take another look please?

@@ -247,6 +247,9 @@ class CharacterFeats<TActor extends CharacterPF2e> extends Collection<string, Fe
if (granter?.isOfType("feat") && granter.grants.includes(feat) && isNested) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that, but Heritage doesn't have .grants, so the check fails and granted items show in bonus feats as duplicates, unfortunately

Comment thread src/module/actor/character/sheet.ts Outdated
level: null,
feat: actor.heritage,
children: this.#getNestedSlots(actor.heritage),
} as never);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed and will keep in mind for the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display Heritages in the Features Tab in the Character Sheet

2 participants